﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Business.ValueObject.SISCONVE;

namespace AdapterSISCONVE.Helper
{
    public static class Mapper
    {
        public static VehicleTypeEnum MapVehicleTypeToVehicleTypeEnum(string vehicleType)
        {
            VehicleTypeEnum vehicleTypeEnum = VehicleTypeEnum.Undefined;

            switch (vehicleType)
            {
                case "Camioneta":
                    vehicleTypeEnum = VehicleTypeEnum.Camioneta;
                    break;
                case "Camión":
                    vehicleTypeEnum = VehicleTypeEnum.Camion;
                    break;
                case "Minibus":
                    vehicleTypeEnum = VehicleTypeEnum.Minibus;
                    break;
                case "Auto":
                    vehicleTypeEnum = VehicleTypeEnum.Auto;
                    break;
                case "Moto":
                    vehicleTypeEnum = VehicleTypeEnum.Moto;
                    break;
            }
            return vehicleTypeEnum;
        }

        public static SignalGPSREnum MapSignalGPSRToSignalGPSREnum(string signalGPSR)
        {
            SignalGPSREnum signalGPSREnum = SignalGPSREnum.OK;
            switch (signalGPSR)
            {
                case "Ok":
                    signalGPSREnum = SignalGPSREnum.OK;
                    break;
                case "Sin señal":
                     signalGPSREnum = SignalGPSREnum.WITHOUT_SIGNAL;
                     break;
            }
            return signalGPSREnum;
        }

        public static PositionACCEnum MapPositionACCToPositionACCEnum(string positionACC)
        {
            PositionACCEnum positionACCEnum = PositionACCEnum.ON;
            switch (positionACC)
            {
                case "ON":
                    positionACCEnum =  PositionACCEnum.ON;
                    break;
                case "OFF":
                    positionACCEnum = PositionACCEnum.OFF;
                    break;
            }
            return positionACCEnum;
        }

        public static BatteryConnectionEnum MapBatteryConnectionToBatteryConnectionEnum(string batteryConnection)
        {
            BatteryConnectionEnum batteryConnectionEnum = BatteryConnectionEnum.OK;
            switch (batteryConnection)
            {
                case "Ok":
                    batteryConnectionEnum = BatteryConnectionEnum.OK;
                    break;
                case "Desconectada":
                    batteryConnectionEnum = BatteryConnectionEnum.DISCONNECTED;
                    break;
            }
            return batteryConnectionEnum;
        }

        public static KeyByPassEnum MapKeyByPassToKeyByPassEnum(string keyByPass)
        {
            KeyByPassEnum keyByPassEnum = KeyByPassEnum.ON;
            switch (keyByPass)
            {
                case "ON":
                    keyByPassEnum = KeyByPassEnum.ON;
                    break;
                case "OFF":
                    keyByPassEnum = KeyByPassEnum.OFF;
                    break;
            }
            return keyByPassEnum;
        }




    }
}
